package cn.edu.scau.cmi.pengjiajian.compositeTransparent;

import java.util.ArrayList;
import java.util.List;

public class Group extends Component{
	private String name;
	private boolean joining;
	private List<Component> list = null;
	
	public Group(String name){
		this.name = name;
		this.joining = false;
		this.list = new ArrayList<>();
	}
	
	public String getName() {
		return  this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public void join() {
		this.joining = true;
	}
	
	public boolean isJoin() {
		return this.joining;
	}

	public void add(Component temp) {
		list.add(temp);
	}
	
	public List<Component> getList(){
		return list;
	}
	
	public void quit() {
		this.joining = false;
	}
}
